[#macro pager pager url parameterMap = {} maxShowtotalPage = 4 ]

    <script type="text/javascript">
        $(function () {
            layui.use(['form', 'layer','upload','layedit'], function () {
                var form = layui.form(), $ = layui.jquery, layer = layui.layer,upload = layui.upload,layedit = layui.layedit;

                form.on('submit(searchForm)', function (data) {
                    var index = layer.load();
                    $.ajax({
                        url: "${url}",
                        data: data.field,
                        success: function (result) {
                            layer.close(index);
                            ondataCallBack(result);

                        },error:function(){
                            layer.close(index);
                        }
                    });
                    return false;
                });
            });
        });


        var extraParam = {};
        function page_search_go2(num){
            if(!num){
                num = 1;
            }
            if(extraParam.page_search_go){
                extraParam.page_search_go("${pager.currentPage}", num);
                return;
            }

            num = isNaN(num) ? 0 : num;
            $("#currentPage").val(num);
            $('#search').click();
//
        }


    </script>
    <style>
        .rate-page .rate-paginator .currentPage{
            border: solid thin #0099FF;
            background-color: #0099FF;
            color: white;
        }
    </style>
    <div class="rate-page">
        <div class="rate-paginator">
            <form class="layui-form"  method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1"/>
                [#list parameterMap.keySet() as k]
                    <input type="hidden" name="${k}" value="${(parameterMap[k])!''}"/>
                [/#list]
                [#assign  keys=parameterMap?keys/]
                [#list keys as key]

                [/#list]
            [#if pager.totalCount > 0]
            [#if pager.currentPage > 1]
                <a class="rate-page-prev" href="javascript:page_search_go2(${pager.currentPage-1});">上一页</a>
            [/#if]
            <a href="javascript:page_search_go2(1);" [#if pager.currentPage = 1]class='currentPage'[/#if]>1</a>
            [#assign startCount = pager.currentPage - maxShowtotalPage/]
            [#if startCount <= 0]
                [#assign startCount = 1 /]
            [/#if]
            [#assign endCount = pager.currentPage + maxShowtotalPage/]
            [#if endCount > pager.totalPage]
                [#assign endCount = pager.totalPage /]
            [/#if]
            [#if startCount > 2]
                <span class="rate-page-break">...</span>
            [/#if]
            [#list startCount..endCount as i]
                [#if i != 1 && i != pager.totalPage]
                    <a href="javascript:page_search_go2(${i});" [#if pager.currentPage = i]class='currentPage'[/#if]>${i}</a>
                [/#if]
            [/#list]
            [#if endCount < pager.totalPage - 1]
                <span class="rate-page-break">...</span>
            [/#if]
            [#if pager.totalPage != 1]
                <a href="javascript:page_search_go2(${pager.totalPage});" [#if pager.currentPage = pager.totalPage]class='currentPage'[/#if]>${pager.totalPage}</a>
            [/#if]
            [#if pager.currentPage < pager.totalPage]
                <a href="javascript:page_search_go2(${pager.currentPage+1});" class="rate-page-next">下一页</a>
            [/#if]
    [/#if]
                <button lay-submit lay-filter="searchForm" id="search" style="display: none;" class="layui-btn" style="width: 280px;margin-top:3px;">搜索</button>

    </form>
        </div>

    </div>

[/#macro]

